package com.xcity.game.activity.cumulativerecharge;

import naga.x.game.template.Template;
import naga.x.game.template.TemplateException;
import naga.x.game.template.annotation.Binding;
import naga.x.game.template.annotation.Excel;

/**
 * 累计充值
 * @author shipeng.zhu
 *
 */
@Excel(value = "activity.xlsx", sheetName = "累计充值")
public class CumulativeRechargeTemplate extends Template {

	/** 活动类型 */
	protected int type;

	/** 需要充值 */
	protected int need;

	/** 奖励钱 */
	protected int money;

	/** 奖励物品1 */
	protected int[] itemIds;

	/** 物品1数量 */
	protected int[] itemCounts;

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getNeed() {
		return need;
	}

	public void setNeed(int need) {
		this.need = need;
	}

	public int getMoney() {
		return money;
	}

	public void setMoney(int money) {
		this.money = money;
	}

	public int[] getItemIds() {
		return itemIds;
	}

	public void setItemIds(int[] itemIds) {
		this.itemIds = itemIds;
	}

	public int[] getItemCounts() {
		return itemCounts;
	}

	public void setItemCounts(int[] itemCounts) {
		this.itemCounts = itemCounts;
	}


	@Override
	public void validate() throws TemplateException {
		if(itemIds == null){
			itemIds = new int[]{};
		}
		if(itemCounts == null){
			itemCounts = new int[]{};
		}
		if(itemIds.length != itemCounts.length){
			throw new TemplateException("activity.xlsx累计充值奖励配置错误->id=" + id);
		}
	}
}
